<?php 

/**
 *
 * Model Base class
 *
 * @package    models
 * @author     Bertrand Kintanar <bertrand.kintanar@gmail.com>
 * @version    $Id: MY_Model.php 94 2011-08-26 03:53:47Z bertrand.kintanar@gmail.com $
 * @copyright  &copy; 2011 NaCl.org WebGroup
 *
 */
namespace models;

defined('BASEPATH') OR exit('No direct script access allowed');

class MY_Model {

    public $em;
    public $qb;

    public function __construct()
    {
        $ci =& get_instance();
        $this->em = $ci->doctrine->em;
        $this->qb = $this->em->createQueryBuilder();
    }

    public function _urlSafe($str)
    {
        $str = strtolower( trim( strip_tags( $str ) ) );
        $str = preg_replace('/[^a-z0-9-]/', '-', $str);
        $str = preg_replace('/-+/', "-", $str);
        
        return $str;
    }
}